package json2;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import json.Person;

import java.util.List;

public class json_hello {
    public static void main(String[] args) {
        Gson gson = new Gson();
        String df = "{\"header\":\"asdfsadfsadfsafdsadfasfdsadfas\",\"date\":\"2018-12-11 14:30\",\"data\":[{\"id\":\"1\",\"username\":\"wangcc\",\"age\":\"18\"}]}";
        Hello hello = gson.fromJson(df,Hello.class);

        List<json2.Hello.DataEntity> data = hello.getData();
        for (json2.Hello.DataEntity dataEntity: data) {

           System.out.println(dataEntity.getAge());
        }
    }
}
